#include <iostream>
#include <future>
#include <thread>
#include <memory>

int Add(int num1, int num2) 
{
    std::cout << "into add!\n";
    return num1 + num2;
}

int main()
{
    std::promise<int> pro;
    std::future<int> res=pro.get_future();
    std::thread thr([&pro](){
        int sum=Add(11,22);
        pro.set_value(sum);
    });

    std::cout<<res.get()<<std::endl;
    thr.join();

    return 0;
}